
/*
题目描述：第一次出现一次的字符
 */
public class E50 {
    public static void main(String[] args) {
        String str = "abaccdeff";
        char res = FirstNotRepeating(str);
        System.out.println(res);
    }

    public static char FirstNotRepeating(String str){
        int[] words = new int[58];
        for(int i = 0; i < str.length(); i++){
            words[((int)str.charAt(i)) - 65] += 1;
        }
        for(int i = 0; i < str.length(); i++){
            if(words[((int)str.charAt(i)) - 65] == 1){
                return str.charAt(i);
            }
        }
        return ' ';
    }
}
